package com.BookmanageSystem.service.impl;

import com.BookmanageSystem.dao.UserDao;
import com.BookmanageSystem.entity.User;
import com.BookmanageSystem.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by Administrator on 2017/6/20.
 */
@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserDao userDao;

    public String login(User user) {
        User u = userDao.login(user);
        if(u!=null){
            return "success";
        }
        return "error";
    }

    @Override
    public User getUserByName(String userName) {
        return userDao.getUserByName(userName);
    }

    @Override
    public Integer register(User user) {
        return userDao.register(user)
                ;
    }
}
